package com.photographysharing.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.photographysharing.dto.FansDTO;
import com.photographysharing.entity.Fans;
import com.photographysharing.response.DatasResponse;
import com.photographysharing.service.FansService;
import com.photographysharing.mapper.FansMapper;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* @author Z
* @description 针对表【fans】的数据库操作Service实现
* @createDate 2024-06-03 23:14:51
*/
@Service
public class FansServiceImpl extends ServiceImpl<FansMapper, Fans>
    implements FansService{
    private  FansMapper fansMapper;

    public FansServiceImpl(FansMapper fansMapper) {
        this.fansMapper = fansMapper;
    }

    @Override
    public DatasResponse<FansDTO> getAll(String userId) {
        List<FansDTO> datas = fansMapper.getAll(userId);
        return new DatasResponse<FansDTO>(datas.size(),datas);
    }
}




